#include <stdio.h>
#include <stdlib.h>

#define NormalCode 0
#define ErrorCode 1

typedef struct StringNode *Position; /* 指针即结点位置 */
struct StringNode {
    char data; /* 存储数据 */
    Position next; /* 链接存储中下一个元素的位置 */
};
typedef struct StringHeadNode *String;
struct StringHeadNode {
    Position head; /* 字符串头指针，初始化为NULL */
    int length; /* 字符串长度 */
};

String InitStr() {
    /* 初始化一个空的字符串 */
    String s;

    s = (String)malloc(sizeof(struct StringHeadNode));
    s->head = NULL;
    s->length = 0;

    return s;
}

/* 算法4-8：字符串截取子串操作  SubString(s, pos, len) */
String SubString(String s, int pos, int len) {
    String sub_s;
    Position p, t, tail;
    int count;

    sub_s = InitStr(); /* 初始化新串sub_s */
    if (s->length > 0) { /* 若s不是空串 */
        p = s->head;
        count = 1;
        while ((p != NULL) && (count < pos)) { /* 找第pos个元素 */
            count++;
            p = p->next;
        }
        if ((p != NULL) && (count == pos)) {
            /* 将s串从pos之后的len个字符复制到sub_s */
            count = 0;
            /* 创建临时空头结点 */
            sub_s->head = (Position)malloc(sizeof(struct StringNode));
            tail = sub_s->head;
            while ((p != NULL) && (count < len)) {
                /* 若从pos开始不到len个字符，就截取到s的末尾 */
                t = (Position)malloc(sizeof(struct StringNode));
                t->data = p->data; /* 复制一个新结点 */
                t->next = NULL;
                tail->next = t; /* 将新结点接到sub_s的末尾 */
                tail = tail->next;
                sub_s->length++; /* sub_s 长度加1 */
                p = p->next;
                count++;
            }
        }
    }
    tail = sub_s->head;
    sub_s->head = tail->next;
    free(tail);
    return sub_s;
}
/* 算法4-8 结束 */

String ReadString() {
    String s;
    Position tail;
    char c;

    s = InitStr(); /* 创建空的字符串 */
    s->head = (Position)malloc(sizeof(struct StringNode));
    tail = s->head; /* 先创建临时空头结点 */
    c = getchar();
    while (c != '\n') {
        tail->next = (Position)malloc(sizeof(struct StringNode));
        tail->next->data = c;
        tail = tail->next;
        s->length++;
        c = getchar();
    }
    tail->next = NULL; /* 链表收尾 */
    tail = s->head;
    s->head = s->head->next;
    free(tail); /* 删除临时空头结点 */
    return s;
}

void PrintString(String s) {
    Position p;

    p = s->head;
    while (p != NULL) {
        printf("%c", p->data);
        p = p->next;
    }
}

int main(void) {
    int pos, len;
    String s, sub_s;

    s = ReadString();
    scanf("%d %d", &pos, &len);
    sub_s = SubString(s, pos, len);
    PrintString(sub_s);

    return 0;
}